home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
os2
/
adaptor.zip
/
ADAPT.ZIP
/
adaptor
/
examples
/
purdue
/
prob12.fcm
< prev
next >
Wrap
Text File
|
1993-06-26
|
2KB
|
77 lines
PROGRAM PROB12
C
C PROBLEM 12
C
C REFERENCE: PROBLEMS TO TEST PARALLEL AND VECTOR LANGUAGES
C CSD-TR 516, COMPUTER SCIENCE, PURDUE UNIVERSITY
C JOHN R. RICE, MAY 1, 1985
C
C REVISED BY JOHN R. RICE AND J. JING, OCT. 1, 1990
C
C
C *************************************************
C * Adapted for FORTRAN D benchmarking *
C * by T. HAUPT (haupt@sccs.npac.syr.edu) *
C * *
C * Northeast Parallel Architectures Center *
C * at Syracuse University, Syracuse, NY, USA *
C *************************************************
C
C
C VERSION SIMD/CM2-1.00
C ==================================================
C
INCLUDE '/usr/include/cm/paris-configuration-fort.h'
INTEGER KASES,NK,MK
PARAMETER (KASES=4)
INTEGER N(KASES),M(KASES)
cmf$ layout N(:serial)
cmf$ layout M(:serial)
DATA N / 127,127,511,1023 /
DATA M / 127,511,511,511 /
REAL TP1,TP2
DO 50 K = 1, KASES
CALL CM_TIMER_CLEAR(0)
CALL CM_TIMER_START(0)
DO MANY=1,150
NK=N(K)
MK=M(K)
CALL DOIT(NK,MK,TP1,TP2)
ENDDO
CALL CM_TIMER_STOP(0)
PRINT 80,NK,MK
80 FORMAT ('PROBLEM 12 WITH N,M =',I6,2X,I6)
PRINT*,'GIVES CORNER PRODUCTS =', TP1,TP2
CALL CM_TIMER_PRINT(0)
50 CONTINUE
c STOP
END
SUBROUTINE DOIT(NK,MK,TP1,TP2)
INTEGER NK,MK
REAL TP1,TP2
REAL, ARRAY(NK+1,MK+1) :: ABIG
REAL ACORN
ACORN = .5
ABIG(1:NK,1:MK)=SPREAD([1:NK],2,MK)+SPREAD([1:MK],1,NK)
ABIG(1:NK,MK+1:MK+1)=spread (1.0-[1:NK], 2, 1)
ABIG(NK+1,1:MK)=1.0+[1:MK]
ABIG(NK+1,MK+1)=ACORN
TP1 = ABIG(1,1)*ABIG(1,MK+1)*ABIG(NK+1,MK)*ABIG(NK+1,MK+1)
TP2 = ABIG(NK,MK)*ABIG(NK,MK+1)*ABIG(NK+1,MK)*ABIG(NK+1,MK+1)
c RETURN
END